//
//  WMEArticleInformationModel.m
//  everyDay_duiTang
//
//  Created by 恩叔 on 16/3/7.
//  Copyright © 2016年 enshu. All rights reserved.
//

#import "WMEArticleInformationModel.h"

@implementation WMEArticleInformationModel
- (void)dealloc
{
    [_imageUrl release];/**<文章的图片链接*/
    [_imageType release];/**<文章的图片类型*/
    
    [_articleId release];/**<文章的ID*/
    [_articleTitle release];/**<文章的标题*/
    [_articleSummary release];/**<文章的摘要*/
    [_articleThumbnail release];/**<文章的缩略图*/
    [_articleUrl release];/**<文章的请求链接*/
    [_articleWeblink release];/**<文章的网页链接*/
    [_articlePublishTime release];/**<文章的发布时间*/
    [_articleCreatedTime release];/**<文章的创建时间*/
    [_articleModifiedTime release];/**<文章的修改时间*/
    [_articleStatsRead release];/**<文章的阅读数*/
    [_articleStatsLike release];/**<文章的喜欢数*/
    [_articleStatsDislike release];/**<文章的厌恶数*/
    [_articleStatsComment release];/**<文章的评论*/
    [_articleStatsFavorite release];/**<文章的...*/
    [_articleStatsShare release];/**<文章的分享数*/
    [_articleTags release];/**<文章的标签*/
    
    [_authorId release];/**<作者Id*/
    [_authorName release];/**<专栏名称*/
    [_authorAvatar release];/**<专栏图片*/
    [_authorImage release];/**<不知*/
    [_authorIntroduction release];/**<专栏介绍*/
    [_authorContactId release];/**<联系方式*/
    [_authorServiceParam release];/**<不知道*/
    [_authorContactType release];/**<联系类型 1.微信*/
    [_authorGender release];/**<作者性别 1.女 0.男*/
    [_authorContract release];/**<作家合同*/
    [_authorServiceType release];/**<不懂 nill*/
    [_authorLogo release];/**<作家logo*/
    
    [_categoryId release];/**<类别ID*/
    [_categoryName release];/**<类别名*/
    [_categoryIcon release];/**<类别图标*/
    [_categoryEnglishName release];/**<类别英文名*/
    [_categoryImage release];/**<不知道*/
    [_categoryPriority release];/**<类别优先权*/
    [_categoryGroupId release];/**<类别所在的分组Id*/
    [_categoryGroupName release];/**<类别所在的分组名*/
    [_categoryGroupEnglishName release];/**<类别所在的分组英文名*/
    [_categoryGroupIcon release];/**<类别所在的分组图标*/
    [_categoryGroupLargeIcon release];/**<类别所在的分组大图标*/
    [_categoryGroupColor release];/**<类别所在的分组的颜色*/
    [_categoryGroupImage release];/**<类别所在的分组的图片*/
    
    [_priority release];/**<优先权*/
    [super dealloc];
}

- (void)setValue:(id)value forUndefinedKey:(NSString *)key
{
    if ([key isEqualToString:@"image"]) {
        for (NSDictionary *temp in value) {
            self.imageType = temp[@"type"];
            self.imageUrl = temp[@"url"];
        }
    }
    if ([key isEqualToString:@"author"]) {
        self.authorAvatar = value[@"avatar"];
        self.authorId = value[@"authorId"];
        self.authorName = value[@"name"];
        self.authorImage = value[@"image"];
        self.authorLogo = value[@"logo"];
        self.authorIntroduction = value[@"introduction"];
        self.authorContactType = value[@"contactType"];
        self.authorContactId = value[@"contactId"];
        self.authorGender = value[@"gender"];
        self.authorContract = value[@"contract"];
        self.authorServiceType = value[@"serviceType"];
        self.authorServiceParam = value[@"serviceParam"];
    }
    if ([key isEqualToString:@"article"]) {
        self.articleId = value[@"articleId"];
        self.articleTitle = value[@"title"];
        self.articleSummary = value[@"summary"];
        self.articleThumbnail = value[@"thumbnail"];
        self.articleUrl = value[@"url"];
        self.articleWeblink = value[@"weblink"];
        self.articlePublishTime = value[@"publishTime"];
        self.articleCreatedTime = value[@"createdTime"];
        self.articleCreatedTime = value[@"modifiedTime"];
        self.articleStatsRead = value[@"articleStats"][@"read"];
        self.articleStatsLike = value[@"articleStats"][@"like"];
        self.articleStatsDislike = value[@"articleStats"][@"dislike"];
        self.articleStatsComment = value[@"articleStats"][@"comment"];
        self.articleStatsFavorite = value[@"articleStats"][@"favorite"];
        self.articleStatsShare = value[@"articleStats"][@"share"];
        for (NSString *temp in value[@"tags"]) {
            self.articleTags = temp;
        }
    }
    if ([key isEqualToString:@"category"]) {
        self.categoryId = value[@"categoryId"];
        self.categoryName = value[@"name"];
        self.categoryEnglishName = value[@"englishName"];
        self.categoryIcon = value[@"icon"];
        self.categoryImage = value[@"image"];
        self.categoryPriority = value[@"priority"];
        self.categoryGroupId = value[@"categoryGroup"][@"categoryGroupId"];
        self.categoryGroupName = value[@"categoryGroup"][@"name"];
        self.categoryGroupEnglishName = value[@"categoryGroup"][@"englishName"];
        self.categoryGroupIcon = value[@"categoryGroup"][@"icon"];
        self.categoryGroupLargeIcon = value[@"categoryGroup"][@"largeIcon"];
        self.categoryGroupColor = value[@"categoryGroup"][@"color"];
        self.categoryGroupImage = value[@"categoryGroup"][@"image"];
    }
}

@end
